<?php

namespace app\api\controller;


use app\plugins\coupon\service\UserCouponService;
use Think\Db;

/**
 * 轮播
 */
class Coupon extends Common
{
    /**
     * [__construct 构造方法]
     */
    public function __construct()
    {
        // 调用父类前置方法
        parent::__construct();
    }

    /**
     * [Index 入口]
     * 优惠券列表
     *
     */
    public function Index()
    {

    	$params = $this->data_request;
       
        // 优惠劵列表
        $coupon_params = [
            'user'  => $this->user,
            'where' => [
                'user_id'   => $this->user['id'],
                'is_valid'  => 1,
            ],
        ];
        
        $ret = UserCouponService::CouponUserList($coupon_params);

        return DataReturn('success', 0, $ret['data']);
    
        
    }

    

    
}
?>